/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.evote.monitoreo.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Mendoza
 */
@Entity
@Table(name = "cedula", catalog = "evote", schema = "")
@NamedQueries({
    @NamedQuery(name = "Cedula.findAll", query = "SELECT c FROM Cedula c"),
    @NamedQuery(name = "Cedula.findByIdCedula", query = "SELECT c FROM Cedula c WHERE c.idCedula = :idCedula"),
    @NamedQuery(name = "Cedula.findByTipo", query = "SELECT c FROM Cedula c WHERE c.tipo = :tipo"),
    @NamedQuery(name = "Cedula.findByEstado", query = "SELECT c FROM Cedula c WHERE c.estado = :estado"),
    @NamedQuery(name = "Cedula.findByFechaCreacion", query = "SELECT c FROM Cedula c WHERE c.fechaCreacion = :fechaCreacion"),
    @NamedQuery(name = "Cedula.findByFechaModificacion", query = "SELECT c FROM Cedula c WHERE c.fechaModificacion = :fechaModificacion")})
public class Cedula implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idCedula", nullable = false)
    private Integer idCedula;
    @Column(name = "tipo")
    private Character tipo;
    @Column(name = "estado")
    private Character estado;
    @Column(name = "fechaCreacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaCreacion;
    @Column(name = "fechaModificacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaModificacion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cedulaidCedula")
    private List<Opcion> opcionList;
    @JoinColumn(name = "ProcesoElectoral_idProcesoElectoral", referencedColumnName = "idProcesoElectoral", nullable = false)
    @ManyToOne(optional = false)
    private Procesoelectoral procesoElectoralidProcesoElectoral;

    public Cedula() {
    }

    public Cedula(Integer idCedula) {
        this.idCedula = idCedula;
    }

    public Integer getIdCedula() {
        return idCedula;
    }

    public void setIdCedula(Integer idCedula) {
        this.idCedula = idCedula;
    }

    public Character getTipo() {
        return tipo;
    }

    public void setTipo(Character tipo) {
        this.tipo = tipo;
    }

    public Character getEstado() {
        return estado;
    }

    public void setEstado(Character estado) {
        this.estado = estado;
    }

    public Date getFechaCreacion() {
        return fechaCreacion;
    }

    public void setFechaCreacion(Date fechaCreacion) {
        this.fechaCreacion = fechaCreacion;
    }

    public Date getFechaModificacion() {
        return fechaModificacion;
    }

    public void setFechaModificacion(Date fechaModificacion) {
        this.fechaModificacion = fechaModificacion;
    }

    public List<Opcion> getOpcionList() {
        return opcionList;
    }

    public void setOpcionList(List<Opcion> opcionList) {
        this.opcionList = opcionList;
    }

    public Procesoelectoral getProcesoElectoralidProcesoElectoral() {
        return procesoElectoralidProcesoElectoral;
    }

    public void setProcesoElectoralidProcesoElectoral(Procesoelectoral procesoElectoralidProcesoElectoral) {
        this.procesoElectoralidProcesoElectoral = procesoElectoralidProcesoElectoral;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCedula != null ? idCedula.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cedula)) {
            return false;
        }
        Cedula other = (Cedula) object;
        if ((this.idCedula == null && other.idCedula != null) || (this.idCedula != null && !this.idCedula.equals(other.idCedula))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.evote.monitoreo.entity.Cedula[idCedula=" + idCedula + "]";
    }

}
